{#include file="admin_header.htm"#}
{#include file="admin_ad_nav.htm"#}
<script>
function chk_form()
{
if (FormData.title.value=="")
	{
	alert("请输入广告标题")
	FormData.title.focus();
	return (false);
	}
if (FormData.url.value=="http://")
	{
	alert("请输入链接地址")
	FormData.url.focus();
	return (false);
	}
if (FormData.category_id.value=="")
	{
	alert("请选择分类")
	FormData.category_id.focus();
	return (false);
	}
if (FormData.category_id.value=="")
	{
	alert("请选择分类")
	FormData.category_id.focus();
	return (false);
	}
return (true);
}
</script>
<div class="admin_main_nr_box">
  <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="400" valign="top">
	 <form action="?act=ad_add_save" method="post" enctype="multipart/form-data" name="FormData" id="FormData" onsubmit="return chk_form();">
        <table width="500" border="0" cellspacing="3" cellpadding="3">
          <tr>
            <td width="88" align="right">广告标题：</td>
            <td width="391"><input name="title" type="text" class="article_text_f" id="title" maxlength="50"/></td>
          </tr>
          <tr>
            <td align="right">链接地址：</td>
            <td><input name="url" type="text" class="article_text_f" id="url" value="http://" maxlength="80"/></td>
          </tr>
          <tr>
            <td align="right">选择分类：</td>
<td><select name="category_id" class="article_text_f" id="category_id" style="width:206px;">
{#section name=ad_category loop=$ad_category#}

  <option value="{#$ad_category[ad_category].id#}"  >{#$ad_category[ad_category].categoryname#}</option>          
{#/section#}              
</select></td>
</tr>
          <tr>
            <td align="right">显示顺序：</td>
            <td><input name="show_order" type="text" class="article_text_f" id="show_order" onkeyup="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');" value="50" maxlength="3"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"/>
            数字越大越靠前</td>
          </tr>
		   {#if $type=="2"#}
		    <tr>
            <td align="right">上传图片：</td>
            <td><input type="file" name="img"  style="height:24px; width:272px; font-size:12px; line-height:20px;"  onkeydown="alert('请点击右侧“浏览”选择您电脑上的图片！');return false"/></td>
          </tr>
		   {#/if#}
		  <tr>
            <td align="right" valign="top">备注：</td>
            <td><p>
              <textarea name="notes" style="width:300px; height:50px; font-size:12px; line-height:180%" onpropertychange="if(this.value.length>100){this.value=this.value.slice(0,100)}"></textarea>
              <br />
              (备注不在前台显示，只作为管理员的备忘标记) </p>              </td>
		  </tr>
          <tr>
            <td align="center">&nbsp;</td>
            <td align="left"><input type="submit" name="Submit3" value="确定提交" class="Qishi_submit_a" onmouseover="this.className='Qishi_submit_b'"  onmouseout="this.className='Qishi_submit_a'"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input name="submit22" type="button" class="Qishi_submit_a" onmouseover="this.className='Qishi_submit_b'"  onmouseout="this.className='Qishi_submit_a'" value="返 回" onclick="Javascript:window.history.go(-1)"/>
        <input name="type_id" type="hidden" value="{#$type#}" /></td>
          </tr>
        </table>
      </form>
	  </td>
    </tr>
  </table>
</div>
{#include file="admin_footer.htm"#}
</body>
</html>